Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable readable debug log #22

Merged
merged 1 commit into from
Mar 7, 2024
Merged

chore: enable readable debug log #22

merged 1 commit into from
Mar 7, 2024

Conversation

helio-frota
Copy link
Collaborator

When using the trustify-cli command and enabling RUST_LOG we get unreadable sqlx debug logs:

INFO  sqlx::query] summary="SELECT \"package\".\"id\", \"package\".\"type\", \"package\".\"namespace\", …" db.statement="\n\nSELECT\n  \"package\".\"id\",\n  \"package\".\"type\",\n  \"package\".\"namespace\",\n  \"package\".\"name\"\nFROM\n  \"package\"\nWHERE\n  \"package\".\"type\" = $1\n  AND \"package\".\"namespace\" = $2\n  AND \"package\".\"name\" = $3\nLIMIT\n

With this change we can see:

DEBUG sea_orm::driver::sqlx_postgres] SELECT "package"."id", "package"."type", "package"."namespace", "package"."name" FROM "package" WHERE "package"."type" = 'maven' AND "package"."namespace" = 'com.fasterxml.jackson.dataformat' AND "package"."name" = 'jackson-dataformat-yaml' LIMIT 1

@helio-frota
Copy link
Collaborator Author

Copy link
Contributor

@bobmcwhirter bobmcwhirter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey nice! That has been annoying me.

@bobmcwhirter bobmcwhirter merged commit 9036ae4 into trustification:main Mar 7, 2024
5 checks passed
@bobmcwhirter
Copy link
Contributor

Disabling sqlx would be great. Probably some config with env-logger crate.

@helio-frota helio-frota deleted the be-debug-print branch March 7, 2024 21:05
@helio-frota
Copy link
Collaborator Author

@bobmcwhirter #23 it is possible to disable via seaorm but the example
is doing it directly on the connection options .sqlx_logging(false)

@bobmcwhirter
Copy link
Contributor

Not necessarily opposed to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants